

int maxAscendingSum(int* nums, int numsSize) {

	int* p = nums;
	int max = *p;
	int i = 0;
	while (*p < *(p + 1) && i < numsSize)
	{
		max += *(p+1);
		p++;
		i++;
	}
	int ret = 0;
	if (i+1 < numsSize)
	{
		p++;
		i++;
		ret = maxAscendingSum(p, numsSize - i);
	}
	p = NULL;
	if (max < ret)
		return ret;
	return max;
}